<template>
  <div class="AAT_module">
    <module-header
      :title="title"
      :meter="meter"
      :params="{
        module: 'AAT',
        status,
        Id: '',
        Bore: '',
        Cutting: ''
      }"
    />
    <section class="settings">
      <div class="column">
        <span class="title">发起</span>
        <div class="row">
          <file-upload class="sub-column upload-container" title="相关附件" />
          <div class="sub-column">
            <div class="sub-row">
              <span>任务描述</span>
              <el-input type="textarea" rows="6" resize="none" placeholder="请输入备注信息" />
            </div>
            <div class="sub-row">
              <span>相关工序</span>
              <el-select size="mini" v-model="meter"></el-select>
            </div>
            <div class="sub-row">
              <span>任务类型</span>
              <el-select size="mini" v-model="meter"></el-select>
            </div>
            <div class="sub-row">
              <span>任务发起</span>
              <el-select size="mini" v-model="meter"></el-select>
            </div>
          </div>
        </div>
      </div>
      <div class="column task">
        <span class="title">处理</span>
        <div class="row">
          <file-upload class="sub-column upload-container" title="相关附件" />
          <div class="sub-column">
            <span class="sub-title">处理结果与分析描述</span>
            <el-input type="textarea" rows="12" resize="none" placeholder="请输入备注信息" />
          </div>
        </div>
      </div>
    </section>
    <section class="table">
      <record-table
        title="非标记录表"
        procedure="AAT"
        :meter="meter"
        :limits="RecordTableLimit"
        :params="{
          title,
          Cutting: ''
        }"
        :tableData="tableData"
        :tableColumnDict="tableColumnDict"
      ></record-table>
    </section>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { tableColumnDict, TableColumnType } from './params'
import ModuleHeader from '@/components/basic/ModuleHeader.vue'
import FileUpload from '@/components/basic/FileUpload.vue'
import RecordTable from '@/components/basic/RecordTable.vue'
import { Dictionary } from '@/interface/Basic'
@Component({
  components: {
    ModuleHeader,
    RecordTable,
    FileUpload
  }
})
class NoneStandard extends Vue {
  @Prop() status!: string
  @Prop({ default: '' }) meter!: string
  @Prop({ required: true }) title!: string
  tableData: TableColumnType[] = []
  tableColumnDict = tableColumnDict
  init_button_limit: Dictionary<boolean> = {
    // 保存
    AAG_0: true,
    // 删除
    AAG_1: true,
    // 新建
    AAG_2: true,
    // 读取三坐标
    AAG_3: true,
    // 手动选择三坐标
    AAG_4: true
  }
  get RecordTableLimit(): Dictionary<boolean> {
    const { AAG_0, AAG_1, AAG_2 } = this.init_button_limit
    return {
      Store: AAG_0,
      Create: AAG_2,
      Delete: AAG_1
    }
  }
}
export default NoneStandard
</script>

<style lang="less" scoped>
@import '~@/styles/theme.less';
@import '~@/styles/layout.less';
.AAT_module {
  box-sizing: border-box;
  padding: 20px;
  width: 100%;
  height: 100%;
  #flex(column, flex-start, flex-start);
  section {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 5px;
  }
  .settings {
    flex: 1;
    #flex(row, center, space-between);
    .column {
      box-sizing: border-box;
      padding: 10px;
      width: 50%;
      height: 100%;
      #flex(column, center, flex-start);
      #color(background-color, --module-bg-color);
      #shadow-color(0, 2px, 12px, 0, --primary-shadow-color);
      .title {
        box-sizing: inherit;
        display: block;
        width: 100%;
        text-align: left;
        padding-bottom: 5px;
        margin-bottom: 10px;
        font-size: 16px;
        border-bottom: solid 1px;
        #color(color, --primary-text-color);
        #color(border-bottom-color, --primary-border-color);
      }
      .row {
        flex: 1;
        width: 100%;
        #flex(row, center, space-between);
        .sub-column {
          flex: 1;
          height: 100%;
          #flex(column, center, space-between);
          .sub-row {
            width: 100%;
            #flex(row, center, space-between);
            span {
              margin-right: 5px;
              font-size: 14px;
              white-space: nowrap;
            }
            .el-select {
              flex: 1;
            }
          }
          .sub-row:first-child {
            align-items: flex-start;
          }
        }
        .sub-column:last-child {
          margin-left: 10px;
        }
      }
    }
    .column:last-child {
      margin-left: 20px;
      .sub-column:last-child {
        justify-content: flex-start;
        .sub-title {
          display: block;
          width: 100%;
          text-align: left;
          margin: 8px 0;
          font-size: 16px;
        }
      }
    }
  }
  .table {
    flex: 1;
    padding: 10px;
    margin-bottom: 0;
    overflow: auto;
    #color(background-color, --module-bg-color);
    #shadow-color(0, 2px, 12px, 0, --primary-shadow-color);
  }
}
</style>
